<template>
  <div>
    <!-- 头部 -->
    <div class="index_box">
      <div class="index_boxtopsun">
        <img :src="usermsg.headimgurl" alt>
        <div class="index_boxbom">
          <span>{{usermsg.companyName}}</span>
          <br>
          <span>id:{{usermsg.companyId}}</span>
        </div>
      </div>
      <div class="index_navbox">
        <ul>
          <li>
            <router-link :to="{name:'me_indent',query:{id:1}}">
              <span>{{list.noPayCount}}</span>
              <br>
              <span>未付款</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_indent',query:{id:2}}">
              <span>{{list.waitPayCount}}</span>
              <br>
              <span>待发货</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_indent',query:{id:3}}">
              <span>{{list.PayCount}}</span>
              <br>
              <span>已发货</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_indent',query:{id:4}}">
              <span>{{list.salePayCount}}</span>
              <br>
              <span>售后</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_indent',query:{id:5}}">
              <span>{{list.finishPayCount}}</span>
              <br>
              <span>已完成</span>
            </router-link>
          </li>
        </ul>
      </div>
      <div class="zhanwei"></div>
    </div>

    <!-- 主体导航 -->
    <div class="meindex_bom">
      <div class="mebom_title">我的应用</div>
      <div class="meindex_sun">
        <ul>
          <li>
            <router-link :to="{name:'me_shoukuan',params:{id:usermsg.userId,cmid:usermsg.companyId,companyName:usermsg.companyName}}">
              <img src="../../assets/images/组-22@2x.png" alt>
              <br>
              <span>收款码</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_shop'}">
              <img src="../../assets/images/组-23@2x.png" alt>
              <br>
              <span>店铺设置</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_leimu'}">
              <img src="../../assets/images/组-24@2x.png" alt>
              <br>
              <span>商品类目</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_newgoods',query:{companyid:this.companyid}}" @click.native="goodsfabu()">
              <img src="../../assets/images/组-25@2x.png" alt>
              <br>
              <span>发布商品</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_goods'}">
              <img src="../../assets/images/组-26@2x.png" alt>
              <br>
              <span>商品管理</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{path:'me_favorable',query:{companyid:this.companyid}}">
              <img src="../../assets/images/组-27@2x.png" alt>
              <br>
              <span>优惠促销</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{path:'me_drainage',query:{companyid:this.companyid}}">
              <img src="../../assets/images/组-28@2x.png" alt>
              <br>
              <span>引流入口</span>
            </router-link>
          </li>
          <li>
            <router-link to  @click.native="lastmon()">
              <img src="../../assets/images/组-29@2x.png" alt>
              <br>
              <span>我的钱包</span>
            </router-link>
          </li>
          <li>
            <router-link to @click.native="hostuser()">
              <img src="../../assets/images/组-30@2x.png" alt>
              <br>
              <span>员工账号</span>
            </router-link>
          </li>
           <li v-if="this.iskefu==1">
            <router-link to @click.native="client()">
              <img src="../../assets/images/客服.png" alt>
              <br>
              <span>客户服务</span>
            </router-link>
            </li>
             <li >
            <router-link to @click.native="newshequnma()">
              <img src="../../assets/images/76cb42902b2ec5c36f92dcb048d1f29.png" alt>
              <br>
              <span>社群二维码</span>
            </router-link>
            </li>
        </ul>
      </div>
    </div>
    <!-- 交易数据 -->
    <div class="meindex_msg">
      <div class="memsg_sun">交易数据</div>
      <div class="memsg_box">
        <ul>
          <li>
            <!-- <router-link :to="{path:'me_zhibiao'}"> -->
               <router-link to>
              <div>{{list.todayMoeny|amountMin100(2)}}</div>
              <span>成交金额</span>
            </router-link>
          </li>
          <li>
            <router-link to>
              <div>{{list.visitor}}</div>
              <span>今日访客</span>
            </router-link>
          </li>
          <li>
            <router-link to>
              <div>{{list.consultation}}</div>
              <span>咨询人数</span>
            </router-link>
          </li>
          <li>
            <router-link to>
              <div>{{list.orderSuccess}}</div>
              <span>成交订单</span>
            </router-link>
          </li>
        </ul>
      </div>
    </div>
    <!-- 商品管理 -->
    <div class="meindex_goods">
      <div class="megoods_sun">商品管理</div>
      <div class="megoods_box">
        <ul>
          <li>
            <router-link :to="{name:'me_goods'}">
              <span>{{list.allGoods}}</span>
              <br>
              <span>商品管理</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_goods'}">
              <span>{{list.inGoods}}</span>
              <br>
              <span>出售中</span>
            </router-link>
          </li>
          <li>
            <router-link :to="{name:'me_goods'}">
              <span>{{list.outGoods}}</span>
              <br>
              <span>仓库中</span>
            </router-link>
          </li>
          <li style="width:70px;"></li>

        </ul>
      </div>
    </div>
    <navfooter :pageName=pageName></navfooter>
  </div>
</template>

<script>
import navfooter from '@/views/merchant/footer/me_footer'
export default {
    components:{
      navfooter,
    },
      data() {
        return {
            pageName:'me_index',
            list:'',
            usermsg:'',
            companyid:'',
            companyname:'',
            verify:'',
            boss:'',
            iskefu:''
        }
      },
      mounted(){
         this.info()
         sessionStorage.setItem('sess',2)
      },
      methods:{
        newshequnma(){
         console.log(this.companyid)
           this.$router.push({path:'new_sqma',query: { companyId:this.companyid}})
        },
        info(){

          this.$http.get(this.APIURL_PREFIX+'/api/companyInfo')
        .then((res)=>{
          console.log(res.data.data.companyStatus)
          if(res.data.data.companyStatus==0){
            this.$router.push({name:'shenhezhong'})
          }
           console.log(res.data.code)
           if(res.data.code==3){
             this.$router.push({name:'Business_rzxzy'})
           }else{
             console.log(res)
          this.usermsg=res.data.data
          this.companyid=res.data.data.companyId
          this.companyname=res.data.data.companyName
          this.boss=res.data.data.isCompany
          this.iskefu=res.data.data.iskefu
          console.log(this.companyname)
          console.log(this.usermsg)
          console.log(this.companyid)


            sessionStorage.clear()
        this.$http.get(this.APIURL_PREFIX+'/api/wap/companyDetail')
        .then((res)=>{
            this.list=res.data.data
        })
        .catch((err)=>{
          console.log(err)
        })

           }

        })


        },
        lastmon(){
           if(this.boss==1){
             this.$router.push({name:'me_money'})
           }else{
             layer.msg('您没有该权限')
           }
        },
        client(){
           this.$router.push({path:'me_client',query: { companyid:this.companyid}})
        },
        hostuser(){
           if(this.boss==1){
           this.$router.push({path:'me_account',query: { companyid:this.companyid,companyname:this.companyname}})
           }else{
             layer.msg('您没有该权限')
           }
        },
        goodsfabu(){
          // console.log(888)

        }
      }
};
</script>

<style scoped>
@import "../../assets/personal/css/me_index.css";
</style>
